package com.bigData.main.controller;

import org.apache.hadoop.conf.Configuration;

public class Const {

    public static final String HDFS_URI = "hdfs://192.40.10.130:9000";
    public static final String HC_DIR_BASE = "/hc/hc1"; //文件存储路径
    public static final String HC2_DIR_BASE = "/hc/hc2";//去重处理
    public static final String HC3_DIR_BASE = "/hc/hc3"; //词频统计
    public static final String DB_URL = "jdbc:mysql://localhost:3306/hr?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true";
    public static final String DB_USER = "root";
    public static final String DB_PASSWORD = "123456";
    public static final String LOCAL_DOWNLOAD_DIR = "hdfsxiazai"; // 本地下载目录
    //    public static final String TEMP_UPLOAD_DIR = System.getProperty("java.io.tmpdir") + "/temp_uploads"; // 暂存目录
    public static final String TEMP_UPLOAD_DIR = "temp_uploads"; // 暂存目录

    // 根据 uid 动态生成目录路径
    public static String getHCDir(String uid) {
        return HC_DIR_BASE + "/" + uid;
    }

    public static String getHC2Dir(String uid) {
        return HC2_DIR_BASE + "/" + uid;
    }

    public static String getHC3Dir(String uid) {
        return HC3_DIR_BASE + "/" + uid;
    }

    public static Configuration getHDFSConfig() {
        Configuration config = new Configuration();
        config.set("fs.defaultFS", HDFS_URI);
        return config;
    }
}
